﻿@inject IWorkContext workContext
@inject LocalizationSettings localizationSettings
@inject CommonSettings commonSettings
@inject IEventPublisher eventPublisher
@using Nop.Web.Framework.UI;
@using Nop.Core;
@using Nop.Core.Domain.Localization
@inject Nop.Services.Localization.ILanguageService languageService
@{
    var kendoVersion = "2014.1.318";
    var supportRtl = workContext.WorkingLanguage.Rtl && !localizationSettings.IgnoreRtlPropertyForAdminArea;

    //CSS resources
    if (supportRtl)
    {
        Html.AppendCssFileParts("~/css/admin/styles.rtl.css");
        Html.AppendCssFileParts("~/lib/adminLTE/css/AdminLTE.rtl.css");
        Html.AppendCssFileParts("~/lib/bootstrap/css/bootstrap.rtl.css");
    }
    else
    {
        Html.AppendCssFileParts("~/css/admin/styles.css");
        Html.AppendCssFileParts("~/lib/adminLTE/css/AdminLTE.min.css");
        Html.AppendCssFileParts("~/lib/bootstrap/css/bootstrap.min.css");
    }

    Html.AppendCssFileParts($"~/lib/datatables/buttons.bootstrap.min.css");
    Html.AppendCssFileParts($"~/lib/datatables/buttons.dataTables.min.css");
    Html.AppendCssFileParts($"~/lib/datatables/datatables.min.css");
    Html.AppendCssFileParts($"~/lib/datatables/css/dataTables.bootstrap.css");
    Html.AppendCssFileParts($"~/lib/kendo/{kendoVersion}/kendo.rtl.min.css");
    Html.AppendCssFileParts($"~/lib/kendo/{kendoVersion}/kendo.default.min.css");
    Html.AppendCssFileParts($"~/lib/kendo/{kendoVersion}/kendo.common.min.css");
    Html.AppendCssFileParts("~/lib/jquery-ui/jquery-ui-1.10.3/jquery-ui-themes/smoothness/jquery-ui-1.10.3.custom.min.css");
    Html.AppendCssFileParts("~/lib/fontAwesome/css/font-awesome.min.css");
    Html.AppendCssFileParts("~/lib/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css");
    //AdminLTE Skins (choose a skin from the css/skins)
    Html.AppendCssFileParts("~/lib/adminLTE/css/skins/_all-skins.min.css");

    //scripts
    Html.AppendScriptParts($"~/lib/datatables/buttons.bootstrap.min.js");
    Html.AppendScriptParts($"~/lib/datatables/dataTables.buttons.min.js");
    Html.AppendScriptParts($"~/lib/datatables/moment-with-locales-2.22.2.min.js");
    Html.AppendScriptParts($"~/lib/datatables/datatables.min.js");
    Html.AppendScriptParts($"~/lib/datatables/js/dataTables.bootstrap.min.js");
    Html.AppendScriptParts($"~/lib/datatables/js/jquery.dataTables.min.js");
    Html.AppendScriptParts($"~/lib/kendo/{kendoVersion}/kendo.web.min.js");
    Html.AppendScriptParts("~/js/admin.common.js");
    Html.AppendScriptParts("~/lib/jquery-migrate/jquery-migrate-1.2.1.min.js");
    Html.AppendScriptParts("~/lib/jquery-ui/jquery-ui-1.10.3/jquery-ui-1.10.3.custom.min.js");
    Html.AppendScriptParts("~/lib/jquery-validate/jquery.validate.unobtrusive/jquery.validate.unobtrusive.min.js");
    Html.AppendScriptParts("~/lib/jquery-validate/jquery.validate-v1.11.1/jquery.validate.min.js");
    Html.AppendScriptParts("~/lib/adminLTE/js/adminlte.min.js");
    Html.AppendScriptParts("~/lib/bootstrap/js/bootstrap.min.js");
    Html.AppendScriptParts("~/lib/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js");
    Html.AppendScriptParts("~/lib/jquery/jquery-1.10.2.min.js");

    //page title
    string adminPageTitle = !string.IsNullOrWhiteSpace(ViewBag.Title) ? ViewBag.Title + " / " : "";
    adminPageTitle += T("Admin.PageTitle").Text;

    //X-UA-Compatible tag
    if (commonSettings.RenderXuaCompatible)
    {
        Html.AppendHeadCustomParts($"<meta http-equiv=\"X-UA-Compatible\" content=\"{commonSettings.XuaCompatibleValue}\"/>");
    }

    //event
    eventPublisher.Publish(new PageRenderingEvent(this.Html));
}
<!DOCTYPE html>
<html lang="@languageService.GetTwoLetterIsoLanguageName(workContext.WorkingLanguage)"@(supportRtl ? Html.Raw(" dir=\"rtl\"") : null)>
    <head>
        <title>@adminPageTitle</title>
        <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
        @*Google Font*@
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
        <script>
            var rootAppPath = '@(Url.Content("~/"))';
        </script>
        @Html.NopHeadCustom()
        @Html.NopCssFiles(ResourceLocation.Head, false)
        @Html.NopScripts(ResourceLocation.Head, false)
    </head>
    <body class="hold-transition skin-blue sidebar-collapse">
        <div class="wrapper">
            <div class="content-wrapper">
                @await Html.PartialAsync("~/Areas/Admin/Views/Shared/Notifications.cshtml")
                @RenderBody()
            </div>
        </div>
        @Html.NopCssFiles(ResourceLocation.Footer)
        @Html.NopScripts(ResourceLocation.Footer)
        <script>
            $(document).ready(function () {
                //enable tooltips
                $('[data-toggle="tooltip"]').tooltip();
            });
        </script>
    </body>
</html>
